An Optimization-Based Theory Of Mind For Human-Robot Interaction